<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'app',
  data(){
    return {
      title:'首页',
      titleArr:[
        { path: '/',name:'homepage',title:'首页'},
        { path: '/cart',name:'Cart',title:'购物车'},
        { path: '/mycenter',name:'Mycenter',title:'个人中心'},
        { path: '/detail',name:'Detail',title:'商品详情'},
        { path: '/login',name:'Login',title:'登陆注册'},
        { path: '/orderDetail',name:'OrderDetail',title:'订单详情'},
        { path: '/payment',name:'Payment',title:'支付'},
        { path: '/receivingAddress',name:'ReceivingAddress',title:'管理收货地址'},
        { path: '/search',name:'SearchList',title:'搜索'},
        { path: '/setting',name:'Setting',title:'设置'},
      ]
    }
  },
  computed:{
    routeTitle:function(){
      let title = '';
      // console.log(this.$router.currentRoute.name)
      for(var i = 0; i<this.titleArr.length;i++){
        // console.log(this.titleArr[i].name)
        if(this.$router.currentRoute.name == this.titleArr[i].name){
          // console.log(this.titleArr[i].title)
          title = this.titleArr[i].title
        }
      }
      // console.log(title)
      return title;
    }
  },
  mounted(){
    // console.log(this.titleArr)
  }
}
</script>

<style lang="less">
@import "~vux/src/styles/reset.less";

body {
  background-color: #fbf9fe;
}
.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
  color: #ffa534 !important;
}
.vux-header {
  background: #fbf9fe !important;
}
.vux-header .vux-header-title {
  color: #000 !important;
}
.weui-grid{
  padding: 10px !important;
}
a{
  color: #000;
}
</style>
